home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java Programmer's Toolkit
/
Java Programmer's Toolkit.iso
/
gs3.53
/
devices.doc
< prev
next >
Wrap
Text File
|
1996-01-10
|
82KB
|
1,756 lines
Copyright (C) 1992, 1995 Aladdin Enterprises. All rights reserved.
This file is part of Aladdin Ghostscript.
Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author
or distributor accepts any responsibility for the consequences of using it,
or for whether it serves any particular purpose or works at all, unless he
or she says so in writing. Refer to the Aladdin Ghostscript Free Public
License (the "License") for full details.
Every copy of Aladdin Ghostscript must include a copy of the License,
normally in a plain ASCII text file named PUBLIC. The License grants you
the right to copy, modify and redistribute Aladdin Ghostscript, but only
under certain conditions described in the License. Among other things, the
License requires that the copyright notice and this notice be preserved on
all copies.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This file, devices.doc, gives more detailed documentation about
certain specific devices for which Ghostscript can produce output.
For an overview of Ghostscript and a list of the documentation files, see
README.
Devices for which this file currently contains documentation:
SPARCprinter
HP DeskJet 520, 540, and 560C
HP DeskJet 500C & 550C
HP PaintJet, XL, and XL300
DEC LJ250
Apple Dot Matrix Printer (and Imagewriter)
Epson Stylus Color Printer
Canon BJC-600/BJC-4000 and BJC-800 BubbleJet Color Printers
### ------------------------- The SPARCprinter ------------------------- ###
This section was written by Martin Schulte.
Introduction
------------
The SPARCprinter is is connected to SPARCStation via a special SBUS card's
video inferface, the picture is composed on the host and only a bitmap is
send to the printer unit.
Together with a SPARCprinter, you always buy (as far as I know) software
that enables you to do postscript-printing on your SPARCPrinter.
So, the need for a Ghostscript-Interface to the SPARCPrinter seems low,
but on the other hand some Postscript drawings are not correctly printed
with SUN's software: on some pages occured a thin vertical line of rubbish
(reproducable), on some Mathematica drawings the text at the axes wasn't
rotated.
I tried all of these with Ghostscript and always got the expected results.
However, replacing proprietary software should never be a bad idea.
The problem is that there has yet been no effort to make the SPARCPrinter-
driver behave like a BSD output-filter, I made my tests using the script
mentioned under Installation.
Installation
------------
Add sparc.dev to DEVICE_DEVS and compile ghostscript as described in
make.doc.
Afterwards, you can use the following script (the way of handling standard
input versus filename-arguments doesn't look very clever, has anyone a
better idea ?) to print if you substitute <GSPATH> by the place where you
installed the ghostscript binary:
outcmd1='/vol/local/lib/troff2/psxlate -r'
outcmd2='<GSPATH> -I/home/schulte/gs252 -sDEVICE=sparc -sOUTPUTFILE=/dev/lpvi0 -'
if [ $# -eq 0 ]
then
$outcmd1 | $outcmd2
else
cat $* | $outcmd1 | $outcmd2
fi
Problems
--------
Since /dev/lpvi can only be opened for exclusive use, another job having
opened it (engine_ctl_sparc or another ghostscript as the most probable
canidates) will cause to stop ghostscript with "Error: /invalidfileaccess
in --.outputpage--"
In case of common printer problems like out of paper, a warning describing
the reason will be printed to stdout, the driver will try to access again
and again each five seconds.
Due to a problem with the device-driver (in the kernel) the reason of
printer failure is not always correctly reported to program. This is the
case at least if you open the top cover (Error in the display: E5). Look
to the display at the printer if a "Printer problem with unknown reason"
is reported.
Fatal errors will cause the print-job to be terminated.
### ------------------------------ End --------------------------------- ###
### ------------------- H-P color inkjet printers ---------------------- ###
### (DeskJet 500C, DeskJet 550C, PaintJet, PaintJet XL, PaintJet XL300 ###
### and the DEC LJ250 which can operate in a Paintjet-compatible mode) ###
This section was written by George Cameron.
Information and tips on usage for the drivers contained in gdevcdj.c
====================================================================
OVERVIEW:
There are 6 generic drivers contained in the source module:
1 - cdj500: HP DeskJet 500C and 540C
2 - cdj550: HP DeskJet 550C and 560C
3 - pjxl300: HP PaintJet XL300 and DeskJet 1200C
4 - pjtest: HP PaintJet
5 - pjxltest: HP PaintJet XL
6 - declj250: DEC LJ250
All of these drivers have 8-bit (monochrome), 16-bit and 24-bit
(colour) and for the DJ 550C 32-bit, (colour, cmyk mode)
options in addition to standard colour and mono drivers.
It is also possible to set various printer-specific parameters
from the gs command line, eg.
gs -sDEVICE=cdeskjet -dBitsPerPixel=16 -dDepletion=1 -dShingling=2 tiger.ps
NB/ The old names cdeskjet, cdjcolor and cdjmono drivers have been retained;
however, their functionality duplicates that available using the above
drivers (and cdeskjet is identical to cdj500), ie. we can use:
gs -sDEVICE=cdj500 -dBitsPerPixel=24 ... for cdjcolor, and
gs -sDEVICE=cdj500 -dBitsPerPixel=1 ... for cdjmono
DEFAULT PAPER SIZE:
If the preprocessor symbol A4 is defined, the default paper size is the
European A4 size; otherwise it is the U.S. letter size (8.5"x11"). Other
paper sizes (including A3 for the PaintJet XL and PaintJet XL300) may be
specified on the command line as explained in the Ghostscript documentation.
DEFAULT BITS-PER-PIXEL:
If the preprocessor symbol BITSPERPIXEL is defined as an integer (see below
for the range of allowable values), this number will be used to define the
default bits-per-pixel (ie. bit depth) for the generic drivers. If the
symbol is not defined, the default is set to 24 bits per pixel. It is
of course still possible to specify the value from the command line, as
described below. Note also that the cdeskjet, cdjcolor and cdjmono
drivers are unaffected by setting this symbol, as their default settings
are predefined to be 1, 3 and 24 respectively.
DESKJET PHYSICAL LIMITS:
Maximum printing width = 2400 dots = 8". The printer manuals say that the
maximum recommended printing height on the page is 10.3", but since this
is obviously not true for A4 paper, and I have been unable to detect any
problems in printing longer page lengths, this would seem to be a rather
artificial restriction.
All Deskjets have 1/2" unprintable bottom margin, due to the mechanical
arrangement used to grab the paper. Side margins are approximately 0.25"
for US Letter paper, and 0.15" for A4.
COMMAND LINE PARAMETERS:
Several printer 'properties' have been implemented for these printers.
Those available so far are all integer quantities, and thus may be
specified as eg.
gs -dBitsPerPixel=32 -dShingling=1 ...
which sets the BitsPerPixel parameter to 32 and the Shingling parameter
to 1.
BITS-PER-PIXEL:
All of the drivers in gdevcdj.c accept a command line option to set the
BitsPerPixel property. This gives considerable flexibility in choosing
various trade-offs between speed/quality/colour etc. The valid numbers
are:
1: This is a standard Ghostscript monochrome driver, and uses
black ink (by installing the separate mono cartridge in
the case of the DeskJet 500C, or automatically for the
other printers)
3: A standard Ghostscript colour driver, using internal
dithering. This is fast to compute and to print, but
the clustered dithering can lose some detail and
colour fidelity.
8: An 'error-diffusion' monochrome driver which uses
Floyd-Steinberg dithering to print greyscale images.
The patterns are much more randomised than with the
normal clustered dithering, but the data files can
be much larger and somewhat slower to print.
16: This is a 'cheaper' version of the following (24-bit)
driver, which generates a Floyd-Steinberg colour dithered
output using the minimum amount of memory (this may be
helpful when using IBM PC's when Ghostscript has not
been compiled using a 32-bit 386-style compiler). The
quality can be almost as good as the 24-bit version.
24: A high-quality colour driver using Floyd-Steinberg dithering
for maximum detail and colour range. However it is very
memory intensive and thus can be slow to compute (and it
tends to produce rather larger raw data files, so they
can also be slower to print).
32: This is for the DeskJet 550C only, which uses the black
cartridge and the colour cartridge simultaneously (ie.
CMYK printing). This printer can be both faster and give
higher quality than the DeskJet 500C, because of the
true black ink. (Note that the 24-bit mode also permits
CMYK printing on this printer, and uses less memory. Any
differences between 24-bit and 32-bit should be very small.)
DESKJET PROPERTIES:
The addional properties available for the DeskJets are:
BlackCorrect (int) /* Colour correction to give
* better blacks when using the DJ500C
* in colour mode, eg. the default of 4
* reduces the cyan component to 4/5
* Range accepted: 0 - 9 (0 = none) */
Shingling (int) /* Interlaced, multi-pass printing
* 0 = none, 1 = 50%, 2 = 25%, 2 is
* best & slowest */
Depletion (int) /* 'Intelligent' dot-removal
* 0 = none, 1 = 25%, 2 = 50%, 1 best
* for graphics?
* Use 0 for transparencies */
PAINTJET XL300/PAINTJET XL PROPERTIES:
PrintQuality (int) /* Mechanical print quality
* -1 = fast, 0 = normal, 1 = presentation
* Fast mode reduces ink usage and uses
* single-pass operation for some media
* types. Presentation uses more ink and
* max number of passes, ie. slowest
* printing for highest quality */
RenderType (int) /* 0 = driver does dithering
* 1 = snap to primaries
* 2 = snap black -> white, others to black
* 3 = ordered dither
* 4 = error diffusion
* 5 = monochrome ordered dither
* 6 = monochrome error diffusion
* 7 = cluster ordered dither
* 8 = monochrome cluster ordered dither
* 9 = user-defined dither (not supported)
* 10 = monochrome user-defined dither ns. */
PAINTJET PROPERTIES:
No additional properties
GAMMA CORRECTION:
One consequence of using Floyd-Steinberg dithering rather than Ghostscript's
default clustered ordered dither is that it is much more obvious that the
ink dots are rather larger on the page than their nominal 1/180" or 1/300"
size (clustering the dots tends to minimise this effect). Thus it is often
the case that the printed result is rather too dark. A simple empirical
correction for this may be achieved by preceding the actual postscript
file to be printed by a short file which effectively sets the gamma for
the device, eg.
gs ... gamma.ps colorpic.ps -c quit
where gamma.ps is
%!
{0.333 exp} dup dup currenttransfer setcolortransfer
This example sets the gamma for r, g, and b to 3, which seems to work
reasonably well in practice.
GENERAL TIPS:
For all the above printers, the paper is critically important to the
final results. Smoother, less fibrous paper is generally better (and
suggested types are given in the printer manuals). In particular, the
special ink-jet paper can make a big difference; the colours are
brighter, but most importantly, there is almost no colour bleed, even
with adjacent areas of very heavy inking. Similarly, the special coated
transparencies also work well (and ordinary transparencies do not work
at all!)
The unix-lpr.sh provides one example of setting up a multi-option
colour postscript lpr queue on Unix systems, and includes the ability
to choose a range of different colour options and printer accounting
and error logging.
CAVEAT EMPTOR!:
It is not always easy for me to test all of these drivers, as the only
colour printer I have here is the DeskJet 500C. I rely on others testing
drivers for the additional machines and reporting their findings back to
me.
HP's 600x300 dpi resolution-enhanced mode for inkjet printers
=============================================================
This feature is available on HP's more recent inkjet printers,
including the Deskjet 520 (mono) 540 (mono or colour) and 560C (mono
and colour).
The colour and monochrome drivers for the HP deskjet 550c are
(probably) the best you will get for use with ghostscript, for the
following reasons:
These printers do not offer true 600x300 dpi resolution. Those that
print in colour are strictly 300x300 dpi in colour mode, while in mono
mode there is a pseudo 600x300 dot mode, with the restriction that you
can't print two adjacent dots. Thus, in effect what you have is 600 dpi
dot positioning, but on average you don't get more dots per line.
What this does give is the possibility to have eg. sharper character
outlines, as you can place dots on the edges nearer to their ideal
positions - this is why it is worth doing.
However, HP will not support user-level programming of this
resolution-enhanced mode, one reason being that (I understand) all the
dot spacing has to be done by the driver, and if you get it wrong, you
can actually damage the print head.
To summarise, you may lose a smidgin of (potential) text clarity using
the 550c drivers (cdj550, cdjcolor, cdjmono etc.), but other than that,
they are the ones for the job.
### ------------------------------ End --------------------------------- ###
### ------------------- Apple Dot Matrix Printer ---------------------- ###
This section was written by Mark Wedel.
The Dot Matrix Driver (DMP) driver is a simple driver I wrote. It
could more more efficient, but it seems to print the images fine.
The Dot Matrix Printer was a parallel predecessor to the Imagewriter
printer. As far as I know, the Imagewriter commands are a superset
to those of the Dot Matrix printer, so the driver should work fine at
generating output that can be printed on Imagewriters.
A few notes (from the gdevadmp.c file):
* To print out images, it sets the printer for unidirection printing
* and 15 cpi (120 dpi). IT sets line feed to 1/9 of an inch (72 dpi).
* When finished, it sets things back to bidirection print, 1/8" line
* feeds, and 12 cpi. There does not appear to be a way to reset
* things to initial values.
*
* This code does not set for 8 bit characters (which is required). It
* also assumes that carriage return/newline is needed, and not just
* carriage return. These are all switch settings on the DMP, and
* I have configured them for 8 bit data and cr only.
*
* You can search for the strings Init and Reset (in devdemp.c) to find the
* strings that set up the printer and clear things when finished, and change
* them to meet your needs.
*
* Also, you need to make sure that the printer daemon (assuming unix)
* doesn't change the data as it is being printed. I have set my
* printcap file (sunos 4.1.1) with the string:
* ms=pass8,-opost
* and it works fine.
Mark Wedel
master@cats.ucsc.edu
### ------------------------------ End --------------------------------- ###
### ------------------ The Epson Stylus Color printer ------------------ ###
/*
Epson Stylus-Color Driver, contributed by Gunther Hess (address: see below)
I N T R O D U C T I O N
=======================
This documentation accompanies version 1.20 of the stcolor-driver.
The new feature of this version is the support of deltarow encoding
and some new parameters for direct control of the ESC/P2-Output.
In comparison to the previous public distributed version (1.12) it is
almost a new driver.
Uff, stcinfo.ps finally made it into this release. For those of you,
who work with a ColorAdjustMatrix: The left Color-Triangle is
created without the ColorAdjustMatrix and the Color-Bars with the
primary colors ignore this Matrix too.
U S A G E
=========
This driver is selected with "-sDEVICE=stcolor" and produces output for an
Epson Stylus-Color at 360DpI resolution by default, but it can do much
more with this printer and with significantly better quality, than with
the default-mode and it can also produce code for the monochrome-versions
of this printer.
This can be achieved either via command-line options or via ghostscript-input.
For convienience a Postscript-File is supplied, that can be used as initial
inputfile. Thus, assumed that ghostscript is invoked via "gs" on your computer,
try the following command:
gs -sDEVICE=stcolor -rXDPIxYDPI stcolor.ps ... (e.g.: your input-files)
were XDPI is one of 180/360/720 and YDPI is one of 90/180/360/720. The result
should be significantly better, you may use "stcolor.ps" with other devices
too, but I do not recommend this, since it does nothing then. "stcolor.ps"
should be available with binary distributions and should reside in the
ghostscript input-directory. Thus if ghostscript is part of your
printer-spooler, you can insert
(stcolor.ps) findlibfile { pop run } if pop
to the files you want to run through the improved algorithms and you may want
to adapt this file to your specific needs. The methods and options for this
are described here, but this description is restricted to the gs-options, while
their manipulation at the Postscript-level is documented in "language.doc" and
in the mentioned "stcolor.ps".
Next thing is to explain the options (as written on my unix-system).
The order is somehow related to their use during the printing-Process:
-dUnidirectional - Force unidirectional printing,
recommended for transparencies
-dMicroweave - enable the printers "microweave"-feature
(the driver does weaving internally by default,
which can be applied to more X/Ydpi-combinations
and weaving by the driver reduces execution-time)
-dnoWeave - disable any Weaving, overrides -dMicroweave
(Try it to see the effect of weaving - you won't
use this option again)
-sDithering="name" - select another dithering-algorithm, available are:
"gscmyk" : fast color-output, with CMYK-ProcessColorModel [D]
"gsmono" : fast black & white output
"gsrgb" : fast color-output, with RGB-ProcessColorModel
"fsmono" : Floyd-Steinberg, Monochrome
"fsrgb" : Floyd-Steinberg, with RGB-ProcessColorModel
(Almost identical to cdj550/mjcxxx-Algorithm)
"fsx4" : Floyd-Steinberg, with CMYK-ProcessColorModel
(shares code with fsmono & fsrgb, but is
algorithmically really bad)
"fscmyk" : Floyd-Steinberg, with CMYK-ProcessColorModel
and proper modifications for CMYK
"hscmyk" : modified Floyd-Steinberg with CMYK-Model
("hs" stands for "hess" nor for "high speed",
but the major difference to "fscmyk" is speed)
"fs2" : algorithm by Steven Singer (RGB)
should be identical to escp2cfs2.
-dBitsPerPixel=1...32 - number of bits used for pixel-storage, the larger
the value, the better the quality - at least in
theory. In fsrgb one can gain some speed, when
restricting to 24 Bits, rather than the default
of 30.
-dFlag0 - causes some algorithms to select a uniform
initialisation rather than a set of random-values.
May yield "sharper" image-impression at the
cost of "dithering-atrefacts".
(applies to hscmyk and all fs-modi, except for fs2,
which always uses a constant initialization.)
-dFlag1 ... -dFlag4 - available to future algorithms.
-dColorAdjustMatrix={3/9/16 x float}'
- This is a Matrix to adjust the colors. Values should
be between -1.0 and 1.0, and the number of
values depend on the colormodel used by the
selected algorithm. In RGB- and CMYK-modi a matrix
with 1.0 on the diagonal produces no transformation.
(I could not identify a similar feature at the
language-level, so this option was implemented, it
is really required, but I don't know reasonable
values yet.)
-dCtransfer='{float float ...}', -dMtransfer=..., -dY..., -dK... or
-dRtransfer='{float float ...}', -dG..., -dB... or
-dKtransfer='{float float ...}'
- which is used, depends on the algorithm, which
maybe either either CMYK, RGB or monochrome.
The values are arrays of floats in the range from
0 to 1.0, which represent the visible
color-intensity for the device. One may achieve
similar effects with "setcolortransfer" at the
language-level, but this takes more time and the
underlying-code for the driver-specific parameters
is still required. The size of the arrays is
arbitrary and the defaults are {0.0 1.0}, which
is a linear characteristic, most of the code in
"stcolor.ps" are better transfer-arrays.
-dKcoding='{float...}', -dC..., -dM... etc.
- this are again arrays between 0.0 and 1.0, and
they control the internal coding of the
color-values. Clever usage of this arrays may
yield further enhancements, but no experience yet.
-dColorAdjustMatrix={3/9/16 x float}'
- This is a Matrix to adjust the colors. Values should
be between -1.0 and 1.0, and the number of
values depend on the colormodel used by the
selected algorithm. In RGB- and CMYK-modi a matrix
with 1.0 on the diagonal produces no transformation.
(I could not identify a similar feature at the
language-level, so this option was implemented, it
is really required, but I don't know reasonable
values yet.)
-sModel=st800 - causes output to be suitable for the monochrome
Stylus 800 (no Weaving, no Color).
-sOutputCode= - can be either "deltarow", "plain" or "runlength"
and changes the ESC/P2 (TM) coding-technique used
by the driver. The default is to use the
runlength-encoding. "plain" selects uncompressed
encoding and yields enormeous amounts of data to
generated, while "deltarow" allows for
2D-compression, may reduce size of the data and
printing speed. But there is a *WARNING*
*WARNING* *WARNING*: "deltarow" sometimes causes really bad hangs
on my printer. Conditions do not depend on the
data: sometimes times the same ESC/P2 prints well.
Thus "rle" seems to be adequate.
-descp_Band=1/8/15/24 - Number of Nozzles of scanlines used in printing.
Useful only with -dnoWeave, thus almost useless.
-descp_Width= - Number of Pixels Printed in each scan-Line.
(Useful when tuning Margins only, se below)
-descp_Height= - Length of the entire Page in Pixels
(Parameter of "ESC(C" in default initialization)
-descp_Top= - Top-Margin in scanlines.
(1st Parameter of "ESC(c" in default initialization)
-descp_Bottom= - Bottom-Margin in scanlines.
(2nd Parameter of "ESC(c" in default initialization)
-sescp_Init="..." - Override for the initialization-Sequence.
(Must set Graphics-Mode-1 & Units)
Valid Resolutions:
-r180x90, -r180x180, -r180x360, -r180x720
-r360x90, -r360x180, -r360x360(D), -r360x720
-r720x90, -r720x180, -r720x360, -r720x720
Valid Option Combinations: (Setting them is *NOT* required, driver knows this)
escp_Band ?Weave escp_Band/#Passes
180x 90 15 no-Weave
180x180 1 , 8, 24 no/u-Weave 15/2 sWeave
180x360 15/4 sWeave
180x720 15/8 sWeave
360x 90 15 no-Weave
360x180 1, 8, 24 no/u-Weave 15/2 sWeave
360x360 1, 8, 24 no/u-Weave 15/4 sWeave
360x720 15/8 sWeave
720x 90 15 no-Weave
720x180 15/2 sWeave
720x360 15/4 sWeave
720x720 1 no/u-Weave 15/8 sWeave
*************************************************************************
*************************************************************************
** **
Å** BEWARE: There are only few validity-checks for parameters. A good **
** example is "escp_Band": if you set this, the driver tries **
** to use your value, even if this value is not supported by **
** the printer: **
** **
** YOU ASKED FOR IT, AND YOU GOT IT! **
** **
*************************************************************************
*************************************************************************
A P P L I C A T I O N - N O T E
================================
Quite a bunch of Parameters. Hopefully you never need any of them, besides
feeding "stcolor.ps" to ghostscript in front of your input.
If you want to improve color, you may need to deal with the appropiate
parameters, please read the chapter about color adjustment. But
propably a sound background in color-models is required for that too.
(If you are such a guru, your help is welcome!)
One thing, that at least bothers me, are wrong margins or a too much
restricted print-area on the page. I definitely was unable to provide
a general solution for the Stylus Color and there are new Models up-
coming. Thus I decided to provide a maximum degree of freedom to the
ghostscript-user. That is what all the escp_-Stuff is meant for.
In Addition you may need the Standard-Parameters:
PageSize - Two Floats Entire Page-Width & Height in 1/72"
.HWMargins - four floats Left, Bottom, Right and Top-Margins 1/72"
Margins - Two Integers, Negative, Left & Top Margin in Pixels.
(Adjusts the CTM so, that 1st Pixel of 1st Scan
matches the top-left Position on the Page)
Proably you should try MicroWeave or noWeave prior to Softweave,
with new printers. This mode is documented in the german owner's
maunual only. So now let's wait for Epson's 3600DpI-Printer. The
Driver is already capable of supporting it.
A C K N O W L E D G E M E N T S
===============================
This driver was "copied" from gdevcdj.c (ghostscript-3.12), which was
contributed by:
George Cameron - g.cameron@biomed.abdn.ac.ukis
Koert Zeilstra - koert@zen.cais.com
Eckhard Rueggeberg - eckhard@ts.go.dlr.de
Some of the ESC/P2-code was drawn from gdevescp.c, contributed by
Richard Brown - rab@physics.unimelb.EDU.AU
And several improvements are based on discussions with
Brian Converse - ag899@osfn.rhilinet.gov
Gero Guenther - gero@cs.tu-berlin.de
Jason Patterson - jasonp@fit.qut.edu.au
? Rueschstroer - rue@ibe.med.uni-muenchen.de
Steven Singer - S.Singer@ph.surrey.ac.uk
While I wish to thank all this people mentioned above, they are by no means
responsible for bugs in the stcolor-driver - just for the features.
Duisburg 24-SEP-1995, Gunther Hess
up to sometime E-Mail: hess@ims.fhg.de
After that time, one should use snail-mail or phone:
Gunther Hess phone: ++49 203 376273
Richard Wagner Strasse 112
D-47057 Duisburg
Germany
R E C O M M E N D A T I O N S
=============================
The next section is a contribution from Jason Patterson <jasonp@fit.qut.edu.au>,
who evaluated a previous version (1.17). GhostScript was invoked as follows:
gs -sDEVICE=stcolor [-r720x720] -sDithering=... -sOutputFile=escp.out \
stcolor.ps whatsoever.ps
where "..." is the name of the desired algorithm. "stcolor.ps" was omitted
for the gs-algorithms (gsmono, gsrgb and gscmyk), for which it is useless
*and* it would not allow the selection of "gscmyk".
So here comes a very truncated version of Jasons text:
COLOR DITHERING EXPERIMENTS with gdevstc-1.17
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here is a summary of the results for the following four experiments...
gsmono: What you'd expect from a mono ordered pattern. Like what a lot of
mono laser printers produce.
fsmono: Excellent for monochrome.
gscmyk: Not very good, but then you'd expect that from an ordered pattern.
gsrgb: A little better than gsrgb. More consistent looking.
fs2: Good, but not quite as good as fsrgb. Gets the brightness wrong,
too light at 720dpi, too dark at 360dpi.
fsrgb: Very good, but a little too dark and has a slight blue tint.
hscmyk: Excellent. Slightly better than fsrgb and fs2. On some images, better
than fscmyk. On most, virtually the same.
fscmyk: Excellent. Best. Very, *very* slightly better than hscmyk. Nearly as
good as the EPSON demos (which were done with the Windows driver).
["nearly"? I believe 1.17 is better! G. Hess]
Overall Visual Quality (out of ten):
gsmono |*********
fsmono |*****************
gscmyk |********
gsrgb |*********
fs2 |****************
fsrgb |*****************
hscmyk |******************
fscmyk |******************
+---------------------
0 1 2 3 4 5 6 7 8 9 10
best-to-worst order: color: fscmyk hscmyk fsrgb fs2 gsrgb gscmyk
mono: fsmono gsmono
SANITY NOTE: The above results are only from *four* images, a total of 24
printouts (8 on 720dpi paper, 16 on plain paper). Your results
will almost certainly vary, and your standards might not be
the same as mine, so use these results as a *guide* only, not
as a formal evaluation.
F U T U R E - D E V E L O P M E N T
===================================
Hmm, my husband forces me to say that there will be no future development,
but I think there is a fair chance for bug-fixing and for supplying a
resonable color-adjustment.
Any suggestions, for instance support of the new printer-models, is
welcome, provided that the one who suggests is willing to run some tests.
C O L O R - T R A N S F O R M A T I O N
=======================================
In the initial version of the driver, distributed with Ghostscript-3.33,
the parameter "SpotSize" was the only way to manipulate the colors at the
driver-level. According to the parameters enumerated above, this has changed
significantly with version 1.16 and above. This is the result of
an ongoing discussion about dithering-algorithms and "false color" on the
Epson-Stylus-Color. This initiated the transformation of the stcolor-driver
into a framework for different dithering-algorithms, that provides a generalized
interface to the internal Ghostscript-Color-Models and the other data-structures
related to Ghostscript-Drivers.
The main thing such a framework should be able to do is to deliver the
values the dithering-algorithm needs and since this influences directly
the optical image impression, this transformation should be adjustable without
the need for recompilation and relinking.
In general the process can be described as follows:
ColorAdjustMatrix Coding Transfer
+---------------------+ +---------------------+ +------------------+
| Ghostscript Color | | Ghostscript Raster | | Dithering Data |
| | => | 1/2/4/8/16/24/32Bit | => | 1/3/4x Values |
| 1/3/4x16Bit Values | | for all components | | (arbitrary type) |
+---------------------+ +---------------------+ +------------------+
Due to the limitations on raster-storage, information is lost in the first
transformation step, except for the 16Bit Monochrome-Mode. So any color
adjustment should take place before this step and this is where the optional
ColorAdjustMatrix works.
The first transformation-step is called "coding" and is controlled by the
?coding-Arrays. The Decoding-process expands the range of values
pontentially to a larger range than that provided by the initial ghostscript
color-model. It is therefore a reasonable place to make device- and/or
algorithm-specific adjustments. This is the place where the ?transfer-Arrays
are used. Array-Access might be not the fastest method, but its generality
is superior, so this step is always based upon internaly algorithm-specific
array-access. If 8Bits are stored per color-component and if the algorithm
uses bytes too, the second transformation is included within the first, what
saves significant computation-time when printing the data.
ColorAdjustMatrix
-----------------
The driver supports different "ProcessColorModel"-Values, which raises the
need for different color-adjustments. In the following "CAM" stands for
ColorAdjustMatrix:
DeviceGray: (3 Floats):
if((r == g) && (g == b))
K' = 1.0 - R;
else
K' = 1.0 - CAM[0] * R + CAM[1] * G + CAM[2] * B;
According to the documentation in drivers.doc, the latter should
never happen.
DeviceRGB: (9 Floats)
if((r == g) && (g == b))
R' = B' = G' = R;
else
R' = CAM[0]*R + CAM[1]*G + CAM[2]*B;
G' = CAM[3]*R + CAM[4]*G + CAM[5]*B;
B' = CAM[6]*R + CAM[7]*G + CAM[8]*B;
The Printer uses always four inks, thus a special treatment of black
is provided. Algorithms may take special action, if r==g==b. Maybe
that in future versions Kcoding & Ktransfer become active in RGB-Mode.
DeviceCMYK: (16 Floats)
if((c == m) && (m == y))
K' = max(C,K);
C' = M' = Y' = 0;
else
K = min(C,M,Y);
if((K > 0) && ColorAdjustMatrix_present) { => UCR
C -= K;
M -= K;
Y -=K;
}
C' = CAM[ 0]*C + CAM[ 1]*M + CAM[ 2]*Y + CAM[ 3]*K;
M' = CAM[ 4]*C + CAM[ 5]*M + CAM[ 6]*Y + CAM[ 7]*K;
Y' = CAM[ 8]*C + CAM[ 9]*M + CAM[10]*Y + CAM[11]*K;
K' = CAM[12]*C + CAM[13]*M + CAM[14]*Y + CAM[15]*K;
Again we have a special black-treatment. "max(C,K)" was introduced
because of a slight misbehaviour of ghostscript, that delivers
black under certain circumstances as (1,1,1,0). Normally, when
no special "Black Seperation" and "Undercolor Removal" procedures
are defined at the postscript-level, either (c,m,y,0) or (0,0,0,k)
values are mapped. This would make the extended ColorAdjustMatrix
quite tedious, thus during mapping black-seperartion is done for
(c,m,y,0)-Requests and if there is a ColorAdjustMatrix, undercolor-
removal is used too. In other words the Default-Matrix is:
1 0 0 1
0 1 0 1
0 0 1 1
0 0 0 1
and it is applied to CMYK-Values with seperated and removed Black.
Raising the CMY-Coefficients while lowering the K-coefficients
reduces black and intensifies color. But be careful, even low
deviations from the default cause drastic changes.
If no ColorAdjustMatrix is set, the matrix-computations are skipped. Thus
the transformation reduces to:
- Range-Inversion in Monochrome-Mode
- Black-Separation in CMYK-Mode
RGB/CMYK-coding & -transfer and BitsPerPixel
--------------------------------------------
This two (groups) of parameters are arrays of floatingpoint-numbers in the
range 0.0 to 1.0. They control the truncation to the desired number of
bits stored in the raster-memory (BitsPerPixel) and the ink-density.
The "truncation" may become a nonlinear-function, if any of the ?coding-arrays
are set. Assume the following Ghostscript invocation:
gs -sDEVICE=stcolor -sDithering=fscmyk -dBitsPerPixel=16 \
-dMcoding='{ 0.0 0.09 0.9 1.0 }' \
-dYtransfer='{ 0.0 0.09 0.9 1.0 }' \
-dKcoding='{ 0.0 0.09 0.9 1.0 }' -dKtransfer='{ 0.0 0.09 0.9 1.0 }' \
We may have ?coding and/or ?transfer, thus four combinations are possible
and this four combinations appear in the given example. The resulting mapping
is given in the following tables, where except for the internal Indices
(4 Components * 4 Bits = 16 BitsPerPixel), all values are normalized to the
Range 0-1. The actual range is 0 to 65535 for the ghostscript-color and
0 to 16777215 (2^24-1) for the ink-values delivered to the fscmyk-algorithm.
Sorry for the bunch of numbers following, but you may try this example in
conjunction with "stcinfo.ps", what should give you a graphical
printout of the following numbers, when you issue a "showpage"-command:
CYAN MAGENTA
CI/15 gs_color_values CI ink gs_color_values CI ink
0.000 0.000 - 0.062 0 0.000 -0.123 - 0.123 0 0.000
0.067 0.063 - 0.125 1 0.067 0.123 - 0.299 1 0.247
0.133 0.125 - 0.187 2 0.133 0.299 - 0.365 2 0.351
0.200 0.188 - 0.250 3 0.200 0.365 - 0.392 3 0.379
0.267 0.250 - 0.312 4 0.267 0.392 - 0.420 4 0.406
0.333 0.313 - 0.375 5 0.333 0.420 - 0.447 5 0.433
0.400 0.375 - 0.437 6 0.400 0.447 - 0.475 6 0.461
0.467 0.438 - 0.500 7 0.467 0.475 - 0.502 7 0.488
0.533 0.500 - 0.562 8 0.533 0.502 - 0.529 8 0.516
0.600 0.563 - 0.625 9 0.600 0.529 - 0.557 9 0.543
0.667 0.625 - 0.687 10 0.667 0.557 - 0.584 10 0.571
0.733 0.688 - 0.750 11 0.733 0.584 - 0.612 11 0.598
0.800 0.750 - 0.812 12 0.800 0.612 - 0.639 12 0.626
0.867 0.813 - 0.875 13 0.867 0.639 - 0.715 13 0.653
0.933 0.875 - 0.937 14 0.933 0.715 - 0.889 14 0.778
1.000 0.938 - 1.000 15 1.000 0.889 - 1.111 15 1.000
The difference between Cyan and Magenta is the presence of a Coding-Array.
The coding-process must map a range of color-values to each of the 16
component-indices. If no coding-array is given, this is accomplished
by a division with 4096 -equivalent to a right-shift by 12 Bits-. The
final ink-density resides in the given interval and moves form the left to
the right side from 0 to 15. In the Magenta-case, there is a coding array
and the ink-value matches the center of the intervals. But the distribution
of the mapped intervals follows the given Coding-Array and is nonlinear in
the linear color-space of ghostscript.
Now let us take a look at the case with Transfer-Arrays:
YELLOW BLACK
CI/15 gs_color_values CI ink gs_color_values CI ink
0.000 0.000 - 0.062 0 0.000 -0.123-0.123 0 0.000
0.067 0.063 - 0.125 1 0.018 0.123-0.299 1 0.067
0.133 0.125 - 0.187 2 0.036 0.299-0.365 2 0.133
0.200 0.188 - 0.250 3 0.054 0.365-0.392 3 0.200
0.267 0.250 - 0.312 4 0.072 0.392-0.420 4 0.267
0.333 0.313 - 0.375 5 0.090 0.420-0.447 5 0.333
0.400 0.375 - 0.437 6 0.252 0.447-0.475 6 0.400
0.467 0.438 - 0.500 7 0.414 0.475-0.502 7 0.467
0.533 0.500 - 0.562 8 0.576 0.502-0.529 8 0.533
0.600 0.563 - 0.625 9 0.738 0.529-0.557 9 0.600
0.667 0.625 - 0.687 10 0.900 0.557-0.584 10 0.667
0.733 0.688 - 0.750 11 0.920 0.584-0.612 11 0.733
0.800 0.750 - 0.812 12 0.940 0.612-0.639 12 0.800
0.867 0.813 - 0.875 13 0.960 0.639-0.715 13 0.867
0.933 0.875 - 0.937 14 0.980 0.715-0.889 14 0.933
1.000 0.938 - 1.000 15 1.000 0.889-1.111 15 1.000
Yellow uses a transfer-array. There is no linear correspondence between
the color- and the ink-values. This correspondence is defined through the
given array. In other words: the Transfer-arrays define a nonlinear
ink-characteristic, what is exactly the same functionaltity, that
Postscripts "(color)transfer"-function provides.
While in the case of Yellow, the intervals match the intervals used with Cyan,
the inetervals used for Black match the Magenta-Intervals, but watch
the corespondence between the CI/15-values and the Ink-Density for Black:
This is a linear distribution in the Ink-domian.
Not a bad idea, I think. Consider the fs2-algorithm: It uses values in
the range 0-255 (Bytes). If any transfer-array would be supplied alone,
some of the 256 possible values would never be used and others will be
used for adjacent intervals several times. Establishing an identical
coding-array solves this problem, so that the full potential of the
algorithm is utilized.
Another useful feature of the coding-arrays is, that they are internally
normalized to the 0-1 Range. In the 720x720Dpi-Mode the transfer-arrays
in stcolor.ps limit the Dot-Density to about 50%, thus this arrays end
at 0.5 (respectively start at 0.5 in the RGB-case). Due to the automatic
normalization this arrays can be used as coding-arrays too. But of course
in the fs2-case mentioned above, values from 0-127 will never be deliverd
to the algorithm, while values 128-255 are delivered for adjacent intervals.
To clearify the intended use of the three parameters/parameter-groups the
following statements should be kept in mind:
- ColorAdjustMatrix is never used, when transferring gray-values. This
restricts it to what the name says: Adjustment of Colors e.g. the
correction for miscolored ink. Do not use it for staturation or
brightness-control.
- ?transfer-arrays control the values delivered to the driver, which in
turn controls the ink-quantity. This arrays should be used for control
of saturation and brightness. Maybe that a Postscript-Header for the
manipulation of brightness and so on will be provided with future
versions. In general this arrays are identical for all inks.
If they differ they provide a simpler scheme for color-correction,
which is not necessarily faster than the ColorAdjustMatrix.
- ?coding-arrays control the color-value-intervals mapped to
the internal color-indices.
P R I N T - M O D I
===================
The parameters "Unidirectional", "Microweave", "noWeave",
"OutputCode", "Model" and the given resolution provide control over the
data generated for the printer.
Unidirectional
--------------
Simply toggles the unidirectional-mode of the printer. Setting "Unidirectional"
definitly decreases printing-speed, but may increase the quality. I use
this for printing tranparencies, where fast head-movement could smear the ink.
Microweave, noWeave and OutputCode=deltarow
-------------------------------------------
The first are two Booleans, what immediatly tells, that 4 combinations are
possible. Actually only three exist (if you don't count for deltarow):
1. Softweave
2. Microweave
3. noWeave
First and second are functionally identical, their difference is that either
the driver or the printer does the job. So the question
What is weaving ?
arises. The Epson Stylus Color has a Head-Assembly that contains two physically
identifiable Heads. One for Black and one for Cyan/Magenta/Yellow. This
makes 4 logical Heads, one for each color-component. Each of this four heads
has several jets at some Y-distance, so several horizontal lines can be printed
during one pass of the heads. From the experience I think there are 15 Jets
per color spaced at 1/90".
So the question arises, how to print at a Y-Resolution of 360Dpi with this
90DpI-Jets. Simply by divison, one gets 360/90 = 4, what tells us, that
4 Passes of the head-assembly are required to achieve a Y-resolution of
360DpI. Weaving is just the scheme how the 15 jets are utilized to print
adjacent horizontal rows:
Weaving noWeave
Pass: 1 2 3 4 1 2 3 4
0/360" jet0 - - - jet0 - - -
1/360" - jet1 - - - jet0 - -
2/360" - - jet2 - - - jet0 -
3/360" - - - jet3 - - - jet0
4/360" jet1 - - - jet1 - - -
5/360" - jet2 - - - jet1 - -
6/360" - - jet3 - - - jet1 -
....
Now let us assume, that the dot-diameter is different for each individual
jet, but the average among the jets matches the desired resolution. With
weaving adjacent rows are printed by different jets, thus the some averaging
takes place. Without weaving adjacent rows are printed by the same jet and
this makes the dot-diameter-deviations visible as 1/90"-stripes in the printout.
In Softweave-Mode (the default) the driver sends the data properly arranged to
the printer, while in Microweave-Mode the printer does the same job. But in
general the host-processor is much faster than the printers processor and
thus it is advantageous to let the host do this job. In addition to that, for
720DpI 8 Passes are required and the amount of buffer-space required to buffer
the data for the passes is far beyond the printers memory. SoftWeave requires
an odd value of "escp_Band", the Stylus Color provides 15 for that.
"OutputCode" controls the encoding used. In the basic modi, the choice consists
of "plain" and "runlength". The computation of runlength-encoded data does not
take much time, at least less than the datatranfer to the printer, thus this
is the recommended mode and of course the default. With the Stylus Color
Epson introduced some new encoding principles, namely "tiff" and "deltarow".
While the first was omitted from this driver, since there were not potential
advantages found, "deltarow" is available as an option. "Softweave" cannot
be used with this encoding, so if "OutputCode=deltarow" is set, Microweave
becomes the default. Maybe that the size of the ESC/P2-code becomes smaller,
but I have never observed increased printing-speed - things tend to become
slower with deltarow compared to Softweave.
Model
-----
Some ESC/P2-Printers, such as the Stylus 800, do not offer Microweave or
the commands required to do Softweave. Setting Model just changes the defaults
and ommits some parts of the initialization-sequence, which are not compatible
with the given printer model. Currently only "st800" is supported besides the
default (stcolor).
BEWARE: BUGS & PITFALLS
=======================
* The given ?coding and ?transfer arrays should be strictly monotonic.
* It is impossible to change WHITE: that's your paper.
Thus R/G/B-transfer should end at 1.0 and C/M/Y/K-transfer should
start at 0.0.
* Usually 8Bits per component yields fastest operation.
* The ColorAdjustMatrix is not used in the reverse-transformation, which
is used, when Gostscript does the dithering (gs*-Modi). Expect funny
results.
* If BitsPerPixel is less than 6, the entire coding/transfer-process
does not work. This is always true for the gs*-modi and becomes true
for the other modi, if BitsPerPixel is forced to low values.
* 720x720Dpi-Printing should never select the gs-modi and should always
use stcolor.ps. (I prefer 360x720)
A D D I N G D I T H E R I N G A L G O R I T H M S
=====================================================
Access to the Ghostscript-sources is required to add a new dithering-algorithm.
The driver-source includes 9 Files:
gdevstc.h - common C-Header, including algorithm-declarartions
gdevstc1.c - "gsmono"-Algortihm
gdevstc2.c - fs-algorithms (access via "fsmono", "fsrgb", "fscmyk")
gdevstc3.c - "gsrgb"-Algorithm
gdevstc4.c - "fs2"-Algorithm
gedevstc.c - basic driver source + gscmyk & hscmyk
stcolor.ps - Postscript-header with ?transfer-Arrays
stcinfo.ps - Test-Page for the Printer
and requires modification of:
devices.doc - That's were this file goes to
devs.mak - device-specific Make-Rules
unix-end.mak - to add the installation-rule for stcolor.ps
In Beta-versions of the driver this documentation resides in a
seperate file named "gdevstc.doc".
While all sources are required to build the driver, only gdevstc2.c and
gdevstc4.c contain real dithering-algorithms, the other three
"algorithm-sources" are considered to be templates to add new algorithms.
Besides writing the source, a modification in "gdevstc.h" is required
(search for "MODIFY HERE" and follow the instructions).
The Algorithm should be implemented as a single function, with the following
arguments:
int stc_newalgo( /* or whatever you like */
stcolor_device *sdev, /* the device-structure */
int npixel, /* Number of Bits/Pixels */
byte *in, /* pixel-values */
byte *buf, /* private buffer */
byte *out); /* one byte per pixel output */
with "in" and "buf" being actually pointers to either "byte", "long" or
"float" values.
The array "in" holds one item of the requested type (byte/long/float) per
color-component (1:K, 3: R G B, 4: C M Y K) for each pixel. Alternatively
the algorithm can request the internal ghostscript-scanline as input, by
setting the flag "STC_DIRECT". This saves memory and potentially time.
The driver-specific values can be found in
((byte/long/float *) (sdev->stc.vals[component]))[component-value]
by such direct-drivers. If a driver works on bytes in most cases the
driver-specific values are stored within the ghostscript-line what
implicitly includes "STC_DIRECT".
Obviously the routine should deliver output to the array of bytes named "out".
It holds one byte per pixel and values should be composed by or'ing
the constants
DevciceGray -> BLACK
DeviceRGB -> RED GREEN BLUE
DeviceCMYK -> CYAN MAGENTA YELLOW BLACK
together (There is no "WHITE" defined, since it is different in RGB and
the other color-modes). The initial contents of "out" is the result of the
previous call to the routine. The routine should deliver 0 upon success.
negative values supress printing (only checked upon the initialization-call).
Besides the "normal" invocation, there are two special calls:
Initialization: npixel holds the NEGATIVE number of pixels then.
Initialization should initialize buf (out is already set to white)
and check the parameters.
White-Call: "in" is set to NULL then. This type of call must be
requested by setting the flag "STC_WHITE".
There is another interesting Driver-Flag, named "STC_CMYK10". This is
useful only for CMYK-Drivers and yields 10Bit Component-Values. Thus
higher color-resolution is achieved. BitsPerPixel cannot be manipulated
with the CMYK10-Coding, it is fixed to 32. The coding is as follows:
gx_color_index: aaaa aaaa aabb bbbb bbbb kkkk kkkk kktt
the "tag" (tt) controls what colors are represented by "a" and "b":
00 -> C = k, M = a, Y = b, K = k
01 -> C = a, M = k, Y = b, K = k
02 -> C = a, M = b, Y = k, K = k
03 -> K = k, (gray-level)
thus the value "(gx_color_index)" 3 represents white with this coding.
Another specificum with this CMYK10-Coding is, that the Ghostscript-Line
represents an array of "gx_color_index"-values and can be manipulated
as such. This saves reasonable processing-time for direct drivers.
Any "normal" CMYK-Driver defaults to CMYK10-Coding, if:
1. It is not a DIRECT-Driver and
2. The range of Values covers more than 8 Bits
Any setting of BitsPerPixel causes such a driver to fall back to the
normal CMYK-Mode.
T E S T S (version 1.13 and above)
==================================
This section should give an overview over the performance in terms of
processing- & printing-time. Printing is done offline (via cp-instruction)
to measure real printing-speed, since at high-resolutions processing-time
is in the same order of magnitude and thus may become the limiting factor.
The various OutputCodes
-----------------------
I ran several files though ghostscript and recorded the size of the code,
the processing time and the printing-time, at least for some of the files.
Always the following options were used:
"-sDEVICE=stcolor -sPAPERSIZE=a4 stcolor.ps - < file.ps"
(Actually "-sPAPERSIZE=a4" is in my gs_init.ps since I'm a germ.)
"Softweave" means actually, that nothing else was used, it is the default and
implies that odd v=40/h=10/m=15 mode (ESC . 1 40 10 15).
"Microweave" is just "-dMicroweave", which is equivalent to "ESC . 1 10 10 1",
with full skip-optimization and microweave-activated.
"deltarow" is the new encoding principle ("ESC . 3 10 10 1") with Microweave on.
It is activated with "-sOutputCode=deltarow".
Finally I wanted to see the plain Kathy Ireland and used "-sOutputCode=plain",
which is just replacing RLE by no encoding, thus "ESC . 0 40 10 15" is
used then.
(So sorry: Kathy was still blue dressed in front of the blue sea on a blue
air-cushion - nice to see but hard to dither)
So here are the results:
golfer.ps colorcir.ps drawing.ps brief.ps
deltarow 572751/48.180u 643374/41.690u 90142/46.180u/1:50 178563/49.350u/2:22
Softweave 559593/46.810u 669966/44.960u 296168/48.160u/1:30 269808/43.320u/1:55
Microweave 590999/56.060u 754276/42.890u 338885/47.060u/1:50 282314/44.690u/2:22
kathy.ps
deltarow 3975334/111.940u/5:35
Softweave 3897112/101.940u/3:10
Microweave 4062829/100.990u/3:15
plain/soft 5072255/104.390u/3:05
Evaluation:
A.) Might be, that I've not choosen the optimal deltarow-code, but even if
it saves at lot of bytes, printing-speed is not increased.
B.) At least the printer prefers plain-kathy. In other words: Sending a
1 Megabyte or 20% more data, has no impact on printing speed.
[drawing.ps is an exception to this rule: plain prints slower than rle]
C.) But "unclever" coding -especially with deltarow- can significantly
slows down printing. But even if very significant advantages in the
size of the code ar achieved, "deltarow" is not competitive.
[colorcir.ps shows savings in deltarow, but printing is a mess.]
Printing-Time related to other options
--------------------------------------
Full page halftone images printed, unless otherwise noted.
DpI print-mode Size Time comments
180x180 mono -/uni 358KB 1:15
-/bi 358KB 0:45
micro/bi 205KB 0:45 (not weaving)
soft/bi 179KB 1:25
color -/bi 641KB 2:45
soft/bi 556KB 1:32
360x360 mono -/uni 269KB 0:50 (b/w Text)
-/bi 269KB 0:35 (b/w Text)
micro/bi 269KB 2:25 (b/w Text)
soft/uni 250KB 3:15 (b/w Text)
soft/bi 250KB 1:55 (b/w Text)
color -/bi 346KB 1:00 (sparse color-page, visible displacements)
micro/bi 346KB 1:50 (sparse color-page, looks buggy - printer?)
soft/bi 294KB 1:30 (sparse color-page, O.K.)
-/bi 2218KB 2:45 (visible stripes)
micro/bi 5171KB 3:17
soft/bi 3675KB 3:05
360x720 mono soft/bi 2761KB 5:40
color soft/bi 7789KB 6:15 (just a small difference!)
720x360 color soft/bi 7182KB 5:40
720x720 color micro/bi 14748KB 30:26 (actually beyond printers capabilities)
soft/bi 14407KB 11:08
Processing-Time
---------------
This table is generated on a 16MB i486/DX2 running under Linux, it is
extended for each version of the driver. User- (u) and System-Time (s)
is given seperately in seconds. Besides the files distributed with
ghostscript, the following inputs are used:
tropics.ps: 6MB-Filesize, 1152x900x24 RGB-Image. (entire page covered)
brief.ps: Full-Text-Page (TeX-fonts) with some Logos. (125K)
drawing.ps: Sparse technical drawing, about 800K-Filesize
kathy.ps: 2MB 640x480x24 Color-Image. (entire page covered)
january.ps: Processing of a 100K JPEG-File
DpI BPP Selected Modi File i486DX2-CPU-Times
1.12/1.13 1.16 1.17 1.20
180x180 8 fsmono,noWeave,Uni tropics.ps 110.79u 2.94s 117.16u 3.11s 119.96u 3.01s 121.12u 2.89s
180x180 8 fsmono,noWeave tropics.ps 112.68u 3.44s 132.85u? 3.19s 120.22u 2.95s 123.76u 2.87s
180x180 1 gsmono,Microweave tropics.ps 119.74u 2.83s 120.95u 2.64s 124.56u 3.01s 121.32u 3.02s
180x180 1 gsmono tropics.ps 119.27u 2.71s 120.11u 2.97s 124.36u 2.95s 122.76u 2.65s
180x180 4 gsrgb,noWeave tropics.ps 230.26u 3.01s 287.15u 2.85s 276.06u 3.27s 289.05u 2.74s
180x180 4 gscmyk [DEFAULT] tropics.ps (231.63u 2.93s) 398.10u 3.11s 394.02u 3.39s 413.78u 2.79s
360x360 1 gsmono,noWeave,Uni brief.ps 8.64u 0.63s 23.75u 1.01s 28.28u 1.20s 27.48u 0.79s
360x360 8 fsmono,noWeave brief.ps 16.76u 0.83s 41.93u 1.29s 43.74u 1.16s 41.30u 1.06s
360x360 4 gsrgb,Microweave brief.ps 22.45u 1.22s 47.18u 1.33s 46.83u 1.41s 46.67u 1.20s
360x360 4 gscmyk brief.ps ---.--u --.--s 23.050 1.20s 23.22u 1.27s 23.33u 1.29s
360x360 24 fsrgb,Uni,Flag0 brief.ps 44.67u 1.04s 57.95u 1.38s 60.11u 1.23s 60.15u 1.16s
360x360 24 fs2 brief.ps ---.--u --.--s 97.75u 1.20s 97.94u 1.17s 99.96u 1.10s
360x360 30 fsrgb brief.ps ---.--u --.--s 85.67u 1.32s 85.42u 1.13s 87.09u 2.25s
(creates colors instead of grays due to random initialization)
360x360 32 hscmyk brief.ps 63.07u 0.83s 74.90u 1.42s 40.16u! 1.33s 45.13u 1.54s
360x360 4 gscmyk,noWeave drawing.ps 27.61u 1.27s 24.71u 1.34s 25.89u 1.62s 24.88u 1.74s
360x360 24 fsrgb,Microweave drawing.ps 52.70u 1.33s 60.21u 1.53s 60.78u 1.29s 62.69u 1.52s
360x360 32 hscmyk drawing.ps 67.75u 1.22s 71.62u 1.40s 43.70u 2.12s 51.99u 2.05s
360x360 32 hscmyk,escp_Band=29 drawing.ps ---.--u --.--s 71.25u 1.62s 42.61u 1.84s 48.89u 1.98s
360x360 4 gscmyk,noWeave tropics.ps (261.34u 4.99s) 429.73u 4.58s 437.40u 4.31s 445.25u 4.46s
360x360 4 gsrgb,noWeave tropics.ps 261.34u 4.99s 342.71u 4.54s 347.41u 5.11s 349.88u 4.41s
360x360 24 fsrgb,Microweave tropics.ps 206.11u 17.81s 216.42u 13.55s 210.40u 13.01s 218.61u 13.14s
360x360 24 fs2 tropics.ps ---.--u --.--s 313.64u 12.27s 320.42u 12.17s 325.77u 12.65s
360x360 32 fscmyk tropics.ps ---.--u --.--s ---.--u --.--s 262.29u 14.08s 268.47u 14.57s
360x360 32 hscmyk tropics.ps 206.67u 18.31s 272.93u 16.90s 224.88u 16.55s 239.12u 16.49s
360x720 8 fsmono tropics.ps 164.69u 15.15s 239.77u 10.31s 240.37u 8.41s 236.25u 9.04s
360x720 16 fsmono tropics.ps ---.--u --.--s 400.94u 26.56s 252.86u 11.82s 247.62u 9.92s
360x720 24 fsrgb tropics.ps 277.30u 22.40s 303.76u 16.55s 304.46u 16.42s 314.24u 16.02s
360x720 32 hscmyk tropics.ps 307.70u 21.68s 388.35u 17.11s 297.32u 17.73s 306.50u 17.54s
720x360 32 hscmyk tropics.ps 299.99u 21.82s 381.58u 17.35s 311.28u 17.70s 525.60u 33.640s?
720x720 8 fsmono tropics.ps 199.06u 18.87s 334.23u 11.60s 333.80u 11.14s 325.19u 11.03s
720x720 24 fsrgb tropics.ps 399.96u 35.99s 461.07u 23.85s 454.11u 22.71s 446.52u 23.78s
720x720 32 hscmyk tropics.ps 473.13u 33.07s 587.53u 25.38s 440.83u 26.02s 429.84u 26.52s
720x720 32 hscmyk,Microweave tropics.ps 506.10u 33.59s 622.07u 27.71s 437.17u 28.27s 420.25u 26.80s
720x720 32 hscmyk,Microweave escher.ps 394.59u 7.85s 223.89u 9.28s 230.01u 6.99s
180x90 1 gsmono,noWeave,Uni golfer.ps 2.00u 0.45s 6.72u 1.14s 5.30u 0.82s 5.10u 0.69s
180x180 8 fsmono,Microweave golfer.ps 6.09u 0.83s 17.21u 2.22s 13.67u 0.95s 13.33u 0.74s
180x360 4 gscmyk escher.ps ---FAILED!--- 48.42u 14.10s 38.32u 1.26s 37.98u 1.25s
180x720 24 fsrgb colorcir.ps 47.25u 5.24s 62.22u 1.30s 53.78u 1.66s 59.05u 0.94s
180x180 8 fsmono,noWeave kathy.ps 35.56u 3.48s 45.00u 1.39s 43.91u 1.72s 46.32u 1.38s
360x90 8 fsmono,noWeave golfer.ps 5.84u 1.08s 14.01u 0.72s 13.56u 0.70s 13.21u 0.70s
360x180 8 fsmono,Microweave golfer.ps 10.13u 1.92s 25.98u 1.30s 24.84u 1.22s 24.33u 1.13s
360x360 24 fsrgb,Microweave kathy.ps 105.98u 15.53s 116.18u 4.46s 122.57u 5.09s 115.18u 5.21s
360x360 30 fsrgb kathy.ps ---.--u --.--s 165.05u 5.26s 164.99u 5.89s 166.70u 5.92s
360x720 24 fsrgb colorcir.ps 91.27u 11.91s 118.96u 2.43s 116.27u 2.53s 105.30u 2.23s
360x720 32 hscmyk colorcir.ps 128.90u 10.43s 140.37u 1.59s 67.43u 1.87s 81.52u 1.60s
720x90 8 fsmono,noWeave golfer.ps 10.64u 2.59s 26.39u 1.22s 29.15u 1.67s 24.54u 1.28s
720x180 24 fsrgb escher.ps 73.60u 10.83s 82.49u 2.31s 78.12u 2.52s 81.84u 2.32s
720x360 24 fsrgb kathy.ps 179.66u 29.56s 205.95u 7.94s 197.64u 8.29s 201.46u 8.14s
720x360 32 hscmyk kathy.ps 227.41u 34.00s 273.93u 8.23s 175.54u 8.50s 175.32u 8.36s
720x360 32 hscmyk january.ps 293.76u 9.67s 163.49u 9.51s 172.33u 10.12s
720x720 32 hscmyk january.ps 295.64u 13.33s 316.55u 12.98s
### ------------------------------ End --------------------------------- ###
### --------------- The BJC-600/BJC-800/BJC-4000 printers -------------- ###
This section was written by Yves Arrouye <Yves.Arrouye@imag.fr>.
HISTORY
-------
The BJC-600 driver was written in the first place by Yoshio Kuniyoshi
<yoshio@nak.math.keio.ac.jp> and later modified by me, Yves Arrouye
<Yves.Arrouye@imag.fr>. We both tried to make it evolve synchronously,
though Yoshio cannot be reached since a long time.
The drivers are based on code for the HP printers by George Cameron
<g.cameron@biomed.abdn.ac.ukis> (in fact, they are in the same file!),
so he's the first person to thank!
The 2.00 version of the drivers was a complete rewrite of the driver
(arguments, optimization, colour handling, in short: everything!) by
Yves Arrouye. The 2.x release is also the first one to be able to
use the full width of an A3 paper size...
VERSION INFORMATION
-------------------
The BJC-600 driver is version 2.13.11 dated 09/23/95.
The BJC-800 driver is version 2.13.03 dated 09/23/95.
COMPILATION NOTES
-----------------
Configuration
-------------
* Default values for options and other stuff
Configuration for the drivers can be made by modifying defauts values
in the file gdevbjc.h or on the compilation line. If you don't do
that, the drivers use reasonable defaults that make them work "as
expected".
All default values given below are defined in this file if you need
to change them to customize your installation (a bad idea, better use
options...).
* CMYK to RGB color conversion
By default, the drivers use the same algorithm as Ghostscript to
convert CMYK colors to RGB. If you prefer to use Adobe formulas,
define USE_ADOBE_CMYK_RGB when compiling. (See the top of the
gdevcdj.c file to see the difference between the two.)
* Vertical centering of the printable area
The drivers center the imageable area horizontally, but no vertically
so that what can be printed does use the most of the output media. If
you define BJC_DEFAULT_CENTEREDAREA when compiling, then the top and
bottom margins will be the same, resulting in a vertically centered
imageable area too.
* Margins
If you define USE_RECOMMENDED_MARGINS then the top and bottom margins
will be se same (i.e. BJC_DEFAULT_CENTEREDAREA will be defined for
you) and these margins will be those recommended by Canon, 12.4 mm.
Because margins are a complicated thing (due to the fact that one
does rely on the mechanical precision of the printer), the drivers do
something about the bottom margin: by default the bottom margin is
9.54 mm for the bjc600 driver and 7 mm for the bjc800 one. If you
define USE_TIGHT_MARGINS then the bottom margin is 7 mm for both
drivers (but I never managed to get my own bjc600 print a line on this
low bound, hence the greater default). Regardless of the presence of
this define, USE_FIXED_MARGINS will not allow the bjc800 to use the
lower 7 mm bottom margin, so if you have a problem with the bottom
margin on a bjc800, just define that (without defining USE_TIGHT_MARGINS,
of course).
Compilation
-----------
Make sure the bjc600 and/or bjc800 devices are in your DEVICE_DEVS
variable. That is look in the makefile for your platform and add them
if necessary. This means for example adding them to the DEVICE_DEVS6
variable. The line should read something like that:
DEVICE_DEVS6=bj10e.dev bj200.dev bjc600.dev bjc800.dev
Now if you get an error from make saying that it does not know how to
make bjc800.dev it's because you have an old makefile with only the
bjc600 device in it. You then have to copy the lines explaining how to
make bjc800.dev in your makefile. These lines are in devs.mak (under
the lines for making bjc600.dev) and should go just after the lines
for making bjc600.dev.
Testing the margins
-------------------
A quick way to be sure that the margins you selected (see above) are
okay is to print a file whose contents are:
%!
clippath stroke showpage
If the margins are okay, you will obtain a rectangle surrounding the
printable area.
USE OF THE DRIVERS
------------------
There are two drivers here: the "bjc600" one supports the BJC-600 and
BJC-4000 (maybe the BJC-70 as well) and the "bjc800" one supports the
BJC-800 series. When remarks here apply to both drivers, the name
"bjc" will be used.
Supported Options and Defaults
------------------------------
(Note: the names "options", "properties" and "parameters" will be used
to designate the same thing: device parameters that you can change
from gs.)
Preamble: if an option is given an incorrect value, an error will
occur. Unless stated otherwise, this error will be a rangecheckerror.
Options may be set from the gs command-line (using the -d and -s
switches or other predetermined switches if they have an effect on the
driver) or using the setpagedevice Level 2 operator if Ghostscript has
been compiled with the level2 device (it should ;-)). There are *no*
special-purpose operators as one was able to find in Level 1 printers.
The default number of bits per pixel for the bjc is 24 (unless you
change the value of BJC_BITSPERPIXEL) and corresponds to a CMYK
printing. Supported modes are 1 bpp and 4 bpp (gray levels), 8 bpp, 16
bpp, 24 bpp and 32 bpp (colours). Colours are preferrably stored in
the CMYK model (which means that with 16 bpp there are only 16
different shades of each color, for example) but it is possible to
store them as RGB color for some depths.
Some modes do Floyd-Steinberg dithering while some others don't and
use the default Ghostscript halftoning (in fact, when halftoning is used
dithering takes also place but due to the low resolutions it is
usually not eficient and thus invisible).
Here is a short description of each printing mode (expressed in
bpp/colors):
32/4 CMYK Colour printing, Floyd-Steinberg dithering.
24/4 Id. (But each primary colour is stored on 6 bits instead of 8.)
24/3 RGB colour printing, Floyd-Steinberg dithering. This mode will
*not* use the black cartridge (that's why it exists, for when you
don't want to use it ;-)). Each primary colour is stored on 8
bits (we have only three colours here, okay?). (Of course, with
this mode you'll get brownish/pinkish output; it will remind you
the first versions of the driver....). This mode is not supported
anymore.
16/4 CMYK colour printing, halftoned by Ghostscript. FS dithering
is still visible here (but the halftone patterns are visible
too!).
8/4 Id. (But each primary colour is stored on 2 bits instead of 4.)
8/1 Gray-levels printing, Floyd-Steinberg dithering.
3/3 RGB colour printing. This mode is not intended to be
used. What I mean is that it should be used only if you
want to use custom halftone screens *and* the halftoning is
broken using the 8/4 mode (some versions of gs have a
problem).
1/1 Gray-levels printing, halftoned by GhostScript.
These modes are selected using the BitsPerPixel *and* Colors integers
options (either from the command line or in a PostScript program using
setpagedevice). See below.
A note about darkness of what is printed: Canon printers do print dark,
really. And the Floyd-Steinberg dithering may eventually darken your image
too. So you may need to apply gamma correction by calling gs as in
% gs -sDEVICE=bjc600 gamma.ps myfile.ps
where gamma.ps changes the gamma correction (here to 3 for all colors):
{ 0.333 exp } dup dup currenttransfer setcolortransfer
The drivers support printing at 90 dpi, 180 dpi and 360 dpi. Horizontal and
vertical resolutions must be the same or a limitcheck error will happen. A
rangecheck will happen too if the resolution is not 90 * 2**n. (If the
driver is compiled with -DBJC_STRICT a rangecheck will also happen if
the resolution is not one of those supported. This is not the case as we
expect that there may be a 720 dpi bjc someday).
Here are the various options supported by the bjc drivers, along with
their type, supported values, effect(s) and usage:
BitsPerPixel (int) Choose the depth of the page. Valid values are
1, 8, 16, 24 and 32. Default is 24.
Note that when this is set for the first
time, the Colors property is automatically
adjusted unless it is also specified. Defaults
adjustments are show in the table below,
default choices are indicated by a star (*).
This table gives also the corresponding
color models and the rendering method that is
visible (GS means Ghostscript halftoning, FS
Floyd-Steinberg dithering, and if both are
present it means that the dithering of
halftones is visible).
+-----+--------+---+----------+-------+
| Bpp | Colors | * | C. Model | Dith. |
+-----+--------+---+----------+-------+
| 32 | 4 | | CMYK | FS |
+-----+--------+---+----------+-------+
| 24 | 4 | * | CMYK | FS |
| | 3 | | RGB | FS |
+-----+--------+---+----------+-------+
| 16 | 4 | | CMYK | GS FS |
+-----+--------+---+----------+-------+
| 8 | 4 | * | CMYK | GS |
| | 1 | | K (CMYK) | FS |
+-----+--------+---+----------+-------+
| 3 | 3 | * | RGB | GS |
+-----+--------+---+----------+-------+
| 1 | 4 | | K (CMYK) | GS |
| | 3 | | K (RGB) | GS |
| | 1 | * | K (CMYK) | GS |
+-----+--------+---+----------+-------+
Valid Colors values for allowed
BitsPerPixel values.
Also note that automagical change of one
parameter depending on the other one does not
work in a setpagedevice call. This means that
if you want to change BitsPerPixel to a value
whose valid Colors values do not include the
actual Colors value, you must change Colors
too.
HWResolution (floats array)
An array of 2 floats giving the horizontal and
vertical resolution in dots per inch. Supported
values are 90, 180 and 360 and both values
must be the same. Default is 360.
(On the gs command line, the resolution is
changed by saying "-rXDPIxYDPI".)
ManualFeed (bool) Indicate that the sheets won't be fed automatically
by the printer. Default is false.
(Not meaningful on the BJC-600, I fear.)
MediaType (string) Choose the media to print on. Values are chose
amongst "PlainPaper", "CoatedPaper",
"TransparencyFilm", "Envelope", "Card" and "Other".
Default is "PlainPaper".
If the chose media is "Envelope", "Card" or
"Other", the driver will make the printer go
in thick mode automatically regardless of the
media weight.
MediaWeight (int or null)
Choose the weight of the media (in g/m2). Using
null indicates that the weight is of no
importance. Default is null.
If the specified media weight is greater
than 105 (i.e. the value of the compilation
default BJC???_MEDIAWEIGHT_THICKLIMIT) then
the printer will be setup to use thick paper.
PrintQuality (string) Choose the quality of printing. For the bjc600
driver it can be one of "Normal", "High" and
"Draft". For the bjc800 driver it can be one
of "Low", "Normal", "High" and "Draft".
Default is "Normal" for both drivers.
For both drivers, "High" means 200% black and
100% cyan, magenta and yellow (on a bjc600 you
will get the "Bk+" light).
For the bjc600 driver, "Normal" lits the
"HQ" light while "Draft" unlits it.
For the bjc800 driver, "Low" has the effect
of making only two printing passes instead of
four (should be twice as fast ;-)). This is
what is known as "CN" (Color Normal) mode.
PrintColors (int) Mask for printing color. If 0, use black for
any color.
Otherwise, the value must be the sum of any
of 1 (cyan), 2 (magenta), 4 (yellow) and 8
(black), indicating which colors will be used
for printing.
When printing colour, only those colour
specified will be printed (this means that
some planes will be missing).
When printing grays, black is used if it is
present in the PrintColors; otherwise, the
data is printed by superimposing each
requested color.
MonochromePrint (bool)
*For bjc600 only*. Substitute black for Cyan,
Magenta and Yellow when printing (useful for
getting some monochrome output of a dithered
printing for example). Default is false.
This is a hardware mechanism as opposed to
the previous software one. I think that using
this or setting PrintColors to 0 will give the
same results.
Note that the MediaType and ThickMedia options will be replaced by the use
of the device InputAttributes and OutputAttributes as soon as possible.
Please note too that the print mode may be reset at the start of a print,
not at the end. This is the expected behaviour. If you need to reset
the printer to its default state, simply print a file that does just a
showpage.
Device Informations
-------------------
Here are other informations published by the driver that you will find
in the deviceinfo dictionary:
OutputFaceUp (bool) This has the boolean value true, indicating that
the sheets are stacked face up.
Version (float) In the form M.mmpp where M is the major version,
mm the bjc drivers minor version and pp the specific
driver minor version (that is, M.mm will always be
the same for the bjc600 and bjc800 drivers).
VersionString (string)
A string that gives the version info plus
other indications. At the moment, things like
'a' or 'b' may follow the version to indicate
alpha or beta versions and the date of the
last change to this version is given in the
form MM/DD/YY (no, it won't adapt to your
locale!).
Hardware Margins
----------------
The BJC printers have top and bottom hardware margins of 3 mm and 7.1
mm respectively (Canon says 7 mm but this is not usable because of
the rounding of paper sizes to PostScript points).. The left margin is
3.4 mm for A4 and smaller paper sizes, 6.4 mm for US paper sizes,
envelopes and cards. It is 4.0 mm for A3 paper on the BJC-800.
The maximum printing width of a BJC-600 printer is 203 mm, in any event.
The maximum printing width of a BJC-800 printer is 289 mm on A3 paper,
and 203 mm on letter and A4 paper.
Reporting Problems
------------------
When you report a problem please be as descriptive as possible, and
please send information that can be used to reproduce the problem.
Please don't forget to tell me which driver you use and its
version. Version information can be found in this file or preferrably
by issuing the following command in a shell:
% echo "currentpagedevice /VersionString get ==" \
gs -q -sDEVICE=bjc600 -
(the % doesn't cound as part of the command and the device name should
be the device you really use).
Contact Address
---------------
If you have problems with this driver (or if you are extremely
satisfied with it) you may email me at Yves.Arrouye@imag.fr.
I consider reusing the "SpotSize" option of the Stylus driver (see
documentation above). I won't do it unless someone ask (with a good
reason), so if you need it, email me...
Acknowledgements
----------------
I am particularly grateful to Yoshio Kuniyoshi <yoshio@nak.math.keio.ac.jp>
without whom I'd never make these drivers and also to Peter L. Deutsch
<ghost@aladdin.com> who answered *all* my (often silly) questions about
the drivers interface used by Ghostscript.
Thanks also to the people who volunteered to beta-test the v2.x
BJC drivers; David Gaudine <david@donald.concordia.ca>, Robert M. Kenney
<rmk@unh.edu>, James McPherson <jmcphers@attila.stevens-tech.edu> and
Ian Thurlbeck <ian@stams.strath.ac.uk> (in an alphabetic listing) were
particularly helpful by discovering bugs and helping find out exact
paper margins on printers I don't have access to.
### ------------------------------ End --------------------------------- ###